import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { IsNotEmpty } from 'class-validator';

@Entity('User')
export class User {
  @PrimaryGeneratedColumn()
  id: string;

  @Column({
    comment: '昵称',
    default: '',
  })
  @IsNotEmpty()
  name: string;

  @Column({
    comment: '描述信息',
    default: '',
  })
  desc: string;

  @Column({
    comment: '手机号',
    default: '',
  })
  tel: string;

  @Column({
    comment: '账号',
    nullable: true,
  })
  account: string;

  @Column({
    comment: '密码',
    nullable: true,
  })
  password: string;

  @Column({
    comment: '验证码',
    nullable: true,
  })
  code: string;

  @Column({
    comment: '验证码生成的时间',
    nullable: true,
  })
  codeCreateAt: Date;

  @Column({
    comment: '头像',
    default: '',
  })
  avatar: string;
}
